# NOT RUN {
library(mnlogit)
data(Fish, package = "mnlogit")
# Unconstrained model
fm <- formula(mode ~ price | income | catch)
fit <- mnlogit(fm, Fish)
# Constrained model - intercep dropped
fm.c <- formula(mode ~ price | income - 1 | catch)
fit.c <- mnlogit(fm.c, Fish)
## MLE hypothesis tests
lrtest(fit, fit.c)
waldtest(fit, fit.c)
scoretest(fit, fit.c)
## IIA test
alt.subset <- c("beach", "boat", "charter")
hmftest(fit, alt.subset)
# }
Run the code above in your browser using DataLab